<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>

        
        // hasOwnProperty()   判断某个对象是否是自身拥有的属性

        function Dog(name) {
            this.name = name ;
        }

        Dog.prototype.type = '狗子' ;

        const d = new Dog('keji') ;

        console.log(d.name);    // 自身的

        console.log(d.type);

        console.log(d.hasOwnProperty('name'));   // true

        console.log(d.hasOwnProperty('type'));   // false

    </script>
    
</body>
</html>